//
//  MYShopDetailsSpecificationsCollCell.swift
//  MuYing
//
//  Created by tbb on 2019/7/30.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class MYShopDetailsSpecificationsCollCell: UICollectionViewCell {
    
    @objc var attrModel = YQPSpuSaleAttrValueListModel()
    @objc @IBOutlet weak var titleBtn: UIButton!
    
//    @objc var isCellSelect = false {
//        didSet {
//            if isCellSelect {
//                self.titleBtn.setTitleColor(appThemeColor, for: .normal);
//                self.titleBtn.layer.borderColor = appThemeColor.cgColor;
//            }else{
//                self.titleBtn.setTitleColor(UIColorFromHex(rgbValue: 0x656565), for: .normal);
//                self.titleBtn.layer.borderColor = UIColorFromHex(rgbValue: 0x000000).withAlphaComponent(0.03).cgColor;
//            }
//        }
//    }
    
    @objc func setModel(_ model:YQPSpuSaleAttrValueListModel)
    {
        self.attrModel = model
//        let select:Int = Int(model.isChecked) ?? 0
//        model.isSelected = select
        if model.isChecked {
            self.titleBtn.setTitleColor(appThemeColor, for: .normal);
            self.titleBtn.layer.borderColor = appThemeColor.cgColor;
        }else{

        self.titleBtn.setTitleColor(UIColorFromHex(rgbValue: 0x656565), for: .normal);
        self.titleBtn.layer.borderColor = UIColorFromHex(rgbValue: 0x000000).withAlphaComponent(0.03).cgColor;
        }
        
        self.titleBtn .setTitle(model.saleAttrValueName, for: .normal)
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.titleBtn.layer.cornerRadius = 4;
        self.titleBtn.clipsToBounds = true;
        self.titleBtn.layer.borderWidth = 1.0;
        self.titleBtn.layer.borderColor = UIColorFromHex(rgbValue: 0x000000).withAlphaComponent(0.03).cgColor;
        
        self.titleBtn.setTitleColor(UIColorFromHex(rgbValue: 0x656565), for: .normal);
        self.titleBtn.isEnabled = false;
    }

}
